<!--
 * @Author: error: git config user.name && git config user.email & please set dead value or install git
 * @Date: 2022-11-05 09:46:17
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2022-11-14 20:24:28
 * @FilePath: \xinta---automatic-backup\src\views\home\admin\components\TransactionTable.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 今日最近异常域名访问事件 -->
<template>
  <div class="wrap">
    <span class="title">今日最近异常事件</span>
    <el-table stripe border :data="list" style="margin-top: 15px;">
      <el-table-column label="序号" width="80"  align="left" type="index">
      </el-table-column>
      <el-table-column label="发生时间" show-overflow-tooltip  align="left" width="170px">
        <template slot-scope="scope">
          {{ scope.row.TransTime }}
        </template>
      </el-table-column>
      <el-table-column label="发生终端" show-overflow-tooltip align="left" width="120px">
        <template slot-scope="scope">
          {{ scope.row.Name }}
        </template>
      </el-table-column>
      <el-table-column label="描述信息" show-overflow-tooltip align="left">
        <template slot-scope="scope">
          {{ scope.row.Descp }}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { GetEventLog } from '@/api/firstPage'
import { getNowDay, parseTime } from '@/utils/index.js'

export default {
  data() {
    return {
      list: null
    }
  },
  created() {
    this.getData()
  },
  methods: {
    async getData() {
      let NowDay = getNowDay('time')
      const data = {
        Paging: {
          QueryPageNo: 1,
          QueryPageLength: 10
        },
        Filter: {
          StartTime: NowDay,
          EndTime: ""
        }
      }
      const res = await GetEventLog(data)
      res.Data.map( item =>{
        item.TransTime = parseTime(item.TransTime)
      })
      this.list = res.Data
    }
  }
}
</script>

<style lang="scss" scoped>
  .wrap{
    height: 370px;
    background: #fff;
  }

</style>
